﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;

namespace IDSDemo.WebApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    [Authorize]
    public class ResourceController : ControllerBase
    {
        [HttpGet]
        [Route("currentuser")]
        public IActionResult GetCurrentUser()
        {
            return new JsonResult(from claim in User.Claims select new {claim.Type,claim.Value,claim.ValueType});
        }
        public IActionResult Get()
        {
            return new JsonResult(from claim in User.Claims select new { claim.Type, claim.Value, claim.ValueType });
        }
    }

}
